package global

import (
	"github.com/go-redis/redis/v8"
	"go-chain-api/config/setting"
	"go-chain-api/tools"
	"go.mongodb.org/mongo-driver/mongo"
	"gorm.io/gorm"
)

var (
	DbConfig          *setting.DbConfig
	BlockChainConfig  *setting.BlockChainConfig
	DBEngine          *mongo.Client
	MysqlDbEngine     *gorm.DB
	RedisEngine       *redis.Client
	MysqlDbConfig     *setting.MysqlDbConfig
	EmailConfig       *setting.EmailConfig
	CallBackUrlConfig *setting.CallBackUrlConfig
	RedisConfig       *setting.RedisConfig
	ConnPool          *tools.ConnectionPool
)

// Response 封装全局返回类型
type Response struct {
	Code int         `json:"code"`
	Data interface{} `json:"data"`
	Msg  string      `json:"msg"`
}

// Page 分页返回类型
type Page struct {
	Total int64       `json:"total"`
	List  interface{} `json:"list"`
}
